#include<stdio.h>
#include<string.h>
#include<unistd.h>
#define NUM 101

int main()
{
    int count = 0;
    char bar[NUM];
    const char *a = "|/-|\\";
    memset(bar, 0, sizeof(bar));

    while(count <= 100)
    {
        printf("[%-100s] [%d%%] %c\r", bar, count ,a[count % 4]);

        bar[count++] = '#';
        fflush(stdout);
        usleep(100000);
    }
    printf("\n");
    return 0;
}
